import React from 'react';

import MyDate from './MyDate';
import './logsItem.css'

const LogsItem = (props) => {
  const deleLogItem = () =>{
    let isDel = window.confirm('确定删除吗')
    if(isDel){
      props.onDeleLog()
    }
  }
  return (
    <div className='item'>
      <MyDate date={props.date}></MyDate>
      <div className='content'>
        <h2 className='desc'>{props.desc}</h2>
        <div className='time'>{props.time}分钟</div>
      </div>

      <button onClick={deleLogItem} style={{height:'40px',margin:'auto 0'}}>删除</button>
    </div>
  );
};

export default LogsItem;